{extend name="$layout" /}
{block name="title"}
	{$title}
{/block}

{block name="top"}
    {notempty name="topbtn"}
    {volist name="topbtn" id="btn"}
    <button class="{$btn.class}" type="button" onclick="app.url('{$btn.href}')">{$btn.title}</button>
    {/volist} 
    {/notempty}
{/block}

{block name="content"}
        <table class="table table-striped">
            <thead>
            <tr>
                <th style="display:none">
                    <label class="css-input css-checkbox css-checkbox-primary remove-margin-t remove-margin-b">
                        <input type="checkbox" id="check-all"><span></span>
                    </label>
                </th>
                {notempty name="columns"}
                {volist name="columns" id="column"}
                <th>{$column.title|default=''|htmlspecialchars}</th>
                {/volist} 
                {/notempty}
            </tr>
            </thead>
            <tbody>
            {notempty name="datasource"}
             {volist name="datasource" id="row"}
            <tr id="{$row[$pid]}">
                <td style="display:none"><input class="ids" type="checkbox" name="id" value=""></td>
                {volist name="columns" id="column"}
                <td>{$row[$column['name']]|default=''}</td> 
                {/volist}
            </tr> 
            {/volist}  
            {/notempty}
            </tbody>
        </table>
        {notempty name="pager"}
        <div>{$pager}</div>
        {/notempty}
{/block}